Real-time network adaptive digital video encoding/decoding

ABSTRACT

A method for real time video transmission over networks with varying bandwidth is described. Image quality is maintained even under degrading network performance conditions through the use of image scaling in conjunction with block based motion compensated video coding (MPEG2/4, H.264, et. Al.). The ability to quickly switch resolutions without decreasing reference frame correlation is shown enabling a fast switch to reduce the required bandwidth for stable image quality.

RELATED APPLICATIONS

This application claims priority from U.S. Provisional Application No. 60/826,008 filed Sep. 18, 2006 and incorporated herein by this reference.

COPYRIGHT NOTICE

© 2006-2007 Elemental Technologies, Inc. A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever. 37 CFR § 1.71(d).

TECHNICAL FIELD

This invention pertains to methods and apparatus for real-time digital video transmission over a network, and more specifically to adapting to variations in the network bandwidth while optimizing image quality.

BACKGROUND OF THE INVENTION

For in the home consumer video applications (TV) quality of service is critical, image breakup, stalling or other artifacts are not acceptable for the market/customer. This presents a serious problem for network based distribution of video in the home, in that the available bandwidth in these networks tends to be unstable/unpredictable. Changing available bandwidth can cause the client devices to fall behind and eventually run out of data for display resulting in the aforementioned issues. Wireless and home-plug based networks are particularly sensitive to this issue because of interference from other devices inside (and outside) the home. However, even if Ethernet or Fiber is available (very rare) changes in network demand based on user usage can cause the same issues. For instance transferring large files or printing while simultaneously streaming video often creates a network bottleneck which the video cannot recover from without visible artifacts.

Most current approaches use a constant bit rate (or near constant) for network video transmission, which requires the smallest available bandwidth to be known prior to initiating the video stream. Since bit rate (bandwidth) and image quality are highly correlated with higher bit rates resulting in better quality, selecting the lowest possible bandwidth will result in the lowest image quality. Even in the case where variable bit rate technology is used it must maintain over the long term a rate that matches the worst case network conditions using today's technology.

The need remains therefore for a way to dynamically adapt to the available network bandwidth so as to optimize image quality.

SUMMARY OF THE INVENTION

Our solution in a preferred embodiment dynamically adapts to the available bandwidth by down-scaling the video image (frames/fields) prior to encoding and transmission. As less bandwidth becomes available, the video is down-scaled by increasing amounts, and conversely when more bandwidth is available, the scaling factor is reduced. Normally, changing the input resolution to an encoder would result in loss of correlation to the already stored reference frames; however, because we also scale the reference frames prior to intra or inter predication, correlation is maintained. Since the lower resolution frames require fewer blocks the overall data rate per frame is reduced.

Additionally, high quality polyphase based image scaling preferably is used which low pass filters the image, thereby reducing aliasing and high frequency content and resulting in better compression at the expense of image sharpness. The scale factor for each image is encoded in the bit stream on a frame by frame basis allowing the decoder to reconstruct the image and maintain a consistent output resolution.

It is to be understood that both the foregoing general description and following more detailed description are exemplary and explanatory only and are not restrictive of the invention as claimed. The accompanying drawings, which are incorporated in a constitute a part of the specification, illustrate an embodiment of the invention and together with the general description, serve to explain rather than limit the principles of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a simplified block diagram illustrating a video decoder consistent with embodiments of the present invention.

FIG. 2 is a simplified block diagram illustrating a video encoder consistent with embodiments of the present invention.

FIG. 3 is a simplified block diagram illustrating one embodiment of a network bandwidth aware video streaming system consistent with the present invention.

FIG. 4 is a simplified illustration of a network adaptive scaling process consistent with one aspect of the present invention.

FIG. 5 is a simplified process flow diagram illustrating one example of an encoding/decoding process in accordance with one embodiment of the invention.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

FIGS. 1 and 2 shows a block diagram of the elemental encoder and decoder. Scalers are introduced into a standard H.264 encoder and decoder at the output of the reference frames and current frame to be encoded to allow for dynamic scaling at any time during the streaming process.

FIG. 3 shows a system block diagram of the network adaptive encoder/decoder streaming pair. The encoding gets its video stream from a hard disk, tv tuner, or the internet and begins encoding it for the client decoder, at the same time, the encoder is monitoring the backchannel from the client (s). As network conditions change, messages are sent back from the client about quality of the network and the encoder then adapts the video as necessary.

FIG. 3 thus illustrates the communication backchannel from the Decoder to the Encoder. When the decoder detects that its buffers are running low (programmable threshold) it sends a message over the network (for example an IP packet) which signals the encoder to reduce its bit rate. The encoder then decides if increased quantization or image downscaling is the preferable method using a decision required amount of bit rate reduction and the current quantization level. If the current quantization level is low and the required rate reduction is small, then increasing the quantization level is selected; otherwise the image in downscaled by an amount based on K*P where K is a programmable value and P is the percent bit rate reduction required.

Alternately, the scaling factor can be derived from a look-up table index by P which allows for non-linear changes in the image scale factor. Since the back channel communications is through the host processor of each device (i.e., Encoder and Decoder) even more complex software based decision algorithms are possible which take into account the latency in the network. In fact the calculation of P by the encoders host processor must take into account the current data rate, decoder's current buffer depth, network latency, and response time. The current data rate (from the decoder's point of view) and decoder buffer depth are values sent from the decoder to the encoder in the back channel IP message. The decoder's view of the data rate is required because there may be buffering in the network infrastructure that masks the encoder from seeing the true data rate. Additionally the network latency can be determined by the encoder (for the backchannel) and the decoder (for the video stream) by comparing timestamp's of when data is sent vs. received. FIG. 4 illustrates this network adaptive scaling process.

FIG. 4 shows an example of high definition frames as they move from the encoder to the decoder in a streaming system. As network bandwidth drops, the encoder will react by either quantizing or in this case, scaling the image before encoding it. The response time of the encoder displayed here is a little more than one frame time. When the decoder and encoder agree that scaling is taking place, through use of extended data in the picture header in the bitstream, the input video resolution is the same as the output resolution. Less bits are required to send the video due to pre-scaling the video on the encoder side, and scaling back to the original side on the decoder side.

While in FIG. 4 we show the entire image being scaled this is not a requirement, in fact the scaling decision can be made on a block by block or region by region basis at the expense of needing to communicate and keep track of all the scaling information. One simple technique that minimizes the amount of scaling information is to use only a single scaling factor and send a single bit for each block/region which indicates if it is to be scaled or not. Using this technique image quality can be improved because regions with high levels of detail that compress efficiently can remain un-scaled, and areas which do not compress are scaled to decrease the bit rate. One possible disadvantage of this technique is that block artifacts may be increased. An alternate (and preferred) approach is to non-linearly scale the image with greater downscaling occurring at the periphery and little scaling in the image center. This is similar to the technique used to convert 16:9 aspect ratio video into 4:3.

As was mentioned earlier in addition to scaling the input frame (image) to the encoder, scaling of reference frames also occurs. This is required because when the scale factor is changed the reference frames used by the encoder are in the original (or last) format (i.e, size). This requires that they be scaled to match the input resolution prior to searching for motion (inter prediction). Once the encoder has switched to the new downscaled resolution its reference frame buffer will fill with the scaled frame data, this is done so that the encoder's reference data matches the decoder's data thereby allowing the decoder to accurately reconstruct its output frames. This presents a problem of loss of reference frame correlation when the scale factor wants to be reduced (i.e., less downscaling) or eliminated. This occurs because the high frequency content of the image has been reduced in the scaling process, so when the reference frame is scaled up to match the new input resolution it will have less detail than you have in the scaled original source. Fortunately this case occurs when more bandwidth has become available which means a simple solution is to insert an intra coded I-Frame (or simply wait until the next point in time when this would be done, usually about 4 times per second) which does not depend on any of the reference frames. A more complex approach would be to attempt to perform inter prediction and if the correlation is good (i.e., low PSNR) then immediately switch to the new resolution, otherwise, use the I-frame approach.

FIG. 5 is a detailed view of the process required when scaling is introduced during an inter-coded frame such as a P or a B frame. Reference frames must be scaled on the encoder and the decoder (decoder not shown) as they will be referenced by the input P or B frame. This example only shows I and P frames, but B frames would also work this way. FIG. 5 gives an example of the entire process from encoding to decoding and output formatting. The methods used and resulting frame resolution are shown. For simplicity in this example only I frames and P frames are shown, B frames which use inter prediction of previous and/or future references frames are not shown, however, the process is basically the same with the exception that depending on circumstances two scalers are required to convert the two reference frames to the correct resolution.

Some of the benefits of embodiments of the present invention include the following:

-   -   Maintains highest possible video quality given the available         network bandwidth.     -   The bandwidth throttling transition is imperceptible to the view         under most network conditions (i.e., assuming the network still         has a minimum level of performance).     -   For multiple networks with multiple video streams this         technology allows each stream to have optimized image quality,         and when new streams are introduced the resulting loss of         bandwidth can be shared across all the other video streams in a         way that is imperceptible to the viewer.

In addition to real time encoding/decoding, the disclosed technology could be used for offline encoding with the result of reduced file size (data size) and/or higher quality image performance during scenes which have fast motion or for some other reason do not compress well. This would be particularly true for cases where a constant bit rate is desired.

It will be obvious to those having skill in the art that many changes may be made to the details of the above-described embodiments without departing from the underlying principles of the invention. The scope of the present invention should, therefore, be determined only by the following claims. 

1. A method for digital video transmission over a network, the method comprising: detecting an initial available network bandwidth; receiving a video input stream for transmission; encoding the received video input stream using inter or intra frame prediction, for transmission to a decoder client, using a first scale factor based on the initial available network bandwidth; detecting a change in the available network bandwidth to a second available network bandwidth; encoding the received input stream using inter or intra frame prediction using a second scale factor based on the second available network bandwidth; communicating the selected first and second scale factors across the network for use in decoding the first and second encoded streams, respectively, to recover a representation of the original video input stream; decoding the first and second encoded streams to recover the video input stream; and coupling the recovered video input stream to a display device.
 2. The method of claim 1 further comprising: imposing a delay after detecting the change in available network bandwidth and before encoding using the second scale factor, the delay corresponding to an amount of time between the detection and a time corresponding to an occurrence of an independently decodable frame in the received input stream; wherein the delay causes the encoding using the second scale factor to initiate at the corresponding time.
 3. The method of claim 1 further comprising: determining whether the second scale factor represents less downscaling than the first scale factor; and inserting an independently decodable frame into the second encoded stream if the second scale factor represents less downscaling than the first scale factor, the independently decodable frame inserted at an encoding transition point and encoded using the second scale factor.
 4. The method of claim 1 wherein the second scale factor scales images from the received video input stream by the product of a predefined programmable amount and a percentage.
 5. The method of claim 4 further comprising: selecting the percentage responsive to detecting the change in available network bandwidth.
 6. The method of claim 1 further comprising: determining a current buffer depth of a decoding buffer used by the decoding client; and selecting the second scale factor according to the determined current buffer depth of the decoding buffer.
 7. The method of claim 1 further comprising: sending a current data rate observed by a decoding client to an encoding endpoint; and selecting the second scale factor at the encoding endpoint according to the current data rate observed at the decoding client.
 8. The method of claim 1 further comprising: comparing first timestamps indicating when encoded data is transmitted from an encoding endpoint to second timestamps indicating when the encoded data is received by a decoding client; and selecting the second scale factor according to the comparison.
 9. A series of machine-readable instructions stored in machine readable media for execution on one or more processors for video decoding, the machine-readable instructions, when executed by the processors, operable to: receive a video input stream for transmission across a network; encode the received video input stream using inter or intra frame prediction, for transmission to a decoding endpoint, using a first scale factor; detect a change in network conditions; encode the received input stream using inter or intra frame prediction using a second different scale factor selected responsive to detecting the change in network conditions; and transmit the selected first and second scale factors from an encoding endpoint, across the network, and to the decoding endpoint, the scale factors transmitted for use by the decoding endpoint in decoding the first and second encoded streams, respectively, to recover a representation of the original video input stream.
 10. The machine-readable instructions of claim 9, further operable to: determine whether the second scale factor represents less downscaling with respect to the first scale factor; and if the second scale factor represents less downscaling, and if the second encoded stream include at least one P or B frame dependent on an I-frame included in the first encoded stream, insert an I-frame into the second encoded stream, the I-frame encoded using the second scale factor and usable for decoding the P or B frame.
 11. The machine-readable instructions of claim 9, further operable to: determine a buffer depth of a decoding buffer used by the decoding endpoint; determine a data rate observed by the decoding endpoint; determine network latency between an encoding endpoint and the decoding endpoint; and select the second scale factor according to the buffer depth, the observed data rate, and the network latency.
 12. The machine-readable instructions of claim 9 wherein the first encoded stream includes first frames representing an image resolution that is different than second frames included in the second encoded stream.
 13. The machine-readable instructions of claim 9 wherein the first encoded stream corresponds to a first High Definition TeleVision (HDTV) standard and the second encoded stream corresponds to a second different HDTV standard.
 14. The machine-readable instructions of claim 9, further operable to: after detecting the change in the network conditions, encode the periphery of images in the received video input stream using the second scale factor while continuing to encoding a center of the images using the first scale factor; wherein the first encoded stream is encoded entirely according to the first scale factor and the second encoded stream is encoded partially according to the first scale factor and partially according to the second scale factor.
 15. The machine-readable instructions of claim 9, further operable to: after detecting the change in the network conditions, encode only a portion of images in the received video input stream using the second scale factor while continuing to encoding other portions of the images using the first scale factor.
 16. A system comprising: means for encoding the received video input stream using inter or intra frame prediction, for transmission to a decoding endpoint, using a first scale factor; means for detecting a change in availability of bandwidth on the network; means for encoding the received input stream using inter or intra frame prediction using a second different scale factor selected responsive to detecting the bandwidth availability change; and means for transmitting the selected first and second scale factors from an encoding endpoint, across the network, and to the decoding endpoint, the scale factors transmitted for use by the decoding endpoint in decoding the first and second encoded streams, respectively, to recover a representation of the original video input stream.
 17. The system of claim 16 further comprising: means for decoding the first and second encoded streams to recover the video input stream at the decoding endpoint; and means for coupling the recovered video input stream to a display device.
 18. The system of claim 16 further comprising: means for determining if the second encoded stream includes dependent frames that depend on a reference frame included in the first encoded stream; and means for formatting a reference frame according to the second scale factor, the formatted reference frame included in the second encoded stream and representing the reference frame included in the first encoded stream.
 19. The system of claim 16 further comprising: means for determining a buffer depth of a decoding buffer used by the decoding endpoint, a data rate observed by the decoding endpoint, and network latency; and means for selecting the second scale factor according to the buffer depth, the observed data rate, and the network latency.
 20. The system of claim 16 further comprising: means for waiting for a time period after the change in available network bandwidth and before encoding using the second scale factor, the time period being an amount of time between the detection and a time corresponding to an occurrence of an independently decodable frame in the received input stream.
 21. The system of claim 16 wherein the first and second encoded streams are encoded using an Motion Picture Expert Group (MPEG) standard. 